import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpExchangeData {
  id!: number;
  eid!: number;
  code!: string;
  userId?: number;
  addTime!: string;
  time?: string;
  state: number = 0;
  type!: number;
  cid?: number;
  termType?: boolean;
  termDay?: number;
  uniacid!: number;
}

export const ImsYzdKpExchangeDataSchema = new EntitySchema({
  class: ImsYzdKpExchangeData,
  properties: {
    id: { primary: true, type: 'number' },
    eid: { type: 'number' },
    code: { type: 'string', length: 255 },
    userId: { type: 'number', nullable: true },
    addTime: { type: 'string', length: 255 },
    time: { type: 'string', length: 255, nullable: true },
    state: { type: 'number', default: 0 },
    type: { type: 'number' },
    cid: { type: 'number', nullable: true },
    termType: { type: 'boolean', nullable: true },
    termDay: { type: 'number', nullable: true },
    uniacid: { type: 'number' },
  },
});
